package com.misboot.document.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import com.misboot.document.utils.PageUtil.PageParam;
import com.misboot.document.utils.PageUtil.PageSet;
import com.misboot.document.utils.PageUtil.PageUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.misboot.document.mapper.OssFileMapper;
import com.misboot.document.model.OssFile;
import com.misboot.document.service.OssFileService;


@Service("ossFileServiceImpl")
public class OssFileServiceImpl extends DocumentBaseServiceImpl<OssFile, String> implements OssFileService {
    @Autowired
    private OssFileMapper ossFileMapper;

    @Override
    public PageSet<OssFile> getPageSet(PageParam pageParam, String filterSort) {
        PageHelper.startPage(pageParam.getPageNo(), pageParam.getPageSize());
        List<OssFile> list = ossFileMapper.getPageSet(filterSort);
        PageInfo<OssFile> pageInfo = new PageInfo<>(list);
        return PageUtils.getPageSet(pageInfo);
    }


    @Override
    public int executeDeleteBatch(String[] uuids) {
        return ossFileMapper.executeDeleteBatch(uuids);
    }


}
